package com.bp.hearthealth.pulse.lnapps.bp_db.bp_bloodpressure

import androidx.room.TypeConverter
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken

class BpBloodPressureListConverter {
    @TypeConverter
    fun fromString(value: String): List<BloodPressureData> {
        val listType = object : TypeToken<List<BloodPressureData>>() {}.type
        return Gson().fromJson(value, listType)
    }

    @TypeConverter
    fun fromList(list: List<BloodPressureData>): String {
        val gson = Gson()
        return gson.toJson(list)
    }
}
